<template>
    <div class="loginForm">
        <el-form :rules="rules"  :model="userData" ref="loginForm">
            <h3>系统登录</h3>
            <el-form-item prop="username">
                <el-input type="test" placeholder="请输入用户名" v-model="userData.username"></el-input>
            </el-form-item>
            <el-form-item prop="password">
                <el-input type="password" placeholder="请输入密码" v-model="userData.password"></el-input>
            </el-form-item>
            <el-form-item>
                <el-checkbox >记住密码</el-checkbox>
            </el-form-item>
            <el-button class="loginBtn" type="primary" size="small" >登录</el-button>

        </el-form>
    </div>
</template>

<script>
    export default {
        name: "Login",
        data(){
            return{
                userData:{
                    username:'',
                    password:''
                },
                rules:{
                   username:[{require:true,message:'请正确填写用户名',trigger:'blur'}],
                   password:[{require:true,message:'请正确填写用户名',trigger:'blur'}],
                }
            }
        },

        methods:{
           /* sumbitLogin(){
                this.$refs['loginForm'].validate((valid) => {
                    if (valid){
                        this.
                    }
                }
            }*/


        },


    }
</script>

<style scoped>
    .loginForm{
        width: 400px;
        padding: 20px;
        margin: 180px auto;
        border: 1px solid ;
        box-shadow: dimgray;


    }

    .loginForm h3{
        text-align: center;
        color:black;
    }
    .loginBtn{
        width: 100%;
    }



</style>